public class method7 {
    public static void main(String[] args) {
        int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9};
        int[]copy=copy(arr,3,7);
        for (int i = 0; i < copy.length; i++) {
            System.out.println(copy[i]+" ");
        }
    }

    public static int[] copy(int[]arr,int form,int to){
        int[] newArr=new int[to-form];
        int index=0;
        for (int i = form; i < to; i++) {
            newArr[index]=arr[i];
            index++;
        }
        return newArr;
    }
    }

